﻿using System;
using System.Reflection;

namespace Ue.Eagle.Runtime.FileSystems.Dependencies
{
    /// <summary>
    /// 插件Assembly文件目录检测（~/App_Data/Dependencies/xxx.dll）
    /// </summary>
    public interface IAssemblyProbingFolder
    {
        /// <summary>
        /// "modelName".dll文件存在于当前文件夹，则返回“true”
        /// </summary>
        bool AssemblyExists(string moduleName);

        /// <summary>
        /// 返回根据moduleName检测Assembly文件并最后修改日期
        /// 如果dll文件不存在，则抛出异常
        /// </summary>
        DateTime GetAssemblyDateTimeUtc(string moduleName);

        /// <summary>
        /// 返回Assembly文件的虚拟路径
        /// </summary>
        string GetAssemblyVirtualPath(string moduleName);

        /// <summary>
        /// 根据moduleName加载Assembly
        /// Assembly文件必须存在，否则反回null
        /// </summary>
        Assembly LoadAssembly(string moduleName);

        /// <summary>
        /// 将Assembly文件从当前目录删除
        /// </summary>
        void DeleteAssembly(string moduleName);

        /// <summary>
        /// 将fileName文件复制保存到当前Assembly目录，并且moduleName命名
        /// </summary>
        void StoreAssembly(string moduleName, string fileName);
    }
}
